package com.yex.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yex.common.utils.PageUtils;
import com.yex.dao.InvestmentLogDao;
import com.yex.entity.InvestmentLogEntity;
import com.yex.service.InvestmentLogService;
import com.yex.utils.Query;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Map;


@Service("investmentLogService")
public class InvestmentLogServiceImpl extends ServiceImpl<InvestmentLogDao, InvestmentLogEntity> implements InvestmentLogService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<InvestmentLogEntity> page = this.selectPage(
                new Query<InvestmentLogEntity>(params).getPage(),
                new EntityWrapper<InvestmentLogEntity>()
        );

        return new PageUtils(page);
    }


    @Override
    public BigDecimal selectInvestmentTotal(Integer investmentId,Integer userId) {
        return baseMapper.selectInvestmentTotal(investmentId,userId);
    }


    @Override
    public BigDecimal selectIntroUserTotal(Integer userId) {
        return baseMapper.selectIntroUserTotal(userId);
    }

    @Override
    public BigDecimal selectIntroDownTotal(Integer userId) {
        return baseMapper.selectIntroDownTotal(userId);
    }

    @Override
    public BigDecimal selectIntroTotal(Integer userId) {
        return baseMapper.selectIntroTotal(userId);
    }
}
